package com.mobjam.workingtitleforagame;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public abstract class MapObject {
	
	protected static Bitmap boyBitmap = null;
	protected static Bitmap girlBitmap = null;
	protected static Bitmap girlBlinkBitmap = null;
	protected static Bitmap storePortalBitmap = null;
	
	public static void loadBitmaps( Context context )
	{
		if( boyBitmap == null )
		{
			boyBitmap = BitmapFactory.decodeResource( context.getResources(), R.drawable.boy);
		}
		
		if( girlBitmap == null )
		{
			girlBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.girleyes );
		}
		
		if( girlBlinkBitmap == null )
		{
			girlBlinkBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.girl );
		}
		
		if( storePortalBitmap == null )
		{
			storePortalBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.store );
		}
	}

	private MapRegion currentRegion;
	private MapTile currentTile;
	private MapObjectType mapObjectType;
	
	/**
	 * @return the currentTile
	 */
	public MapTile getCurrentTile() {
		return currentTile;
	}
	/**
	 * @param currentTile the currentTile to set
	 */
	public void setCurrentTile(MapTile currentTile) {
		this.currentTile = currentTile;
	}

	/**
	 * @return the currentRegion
	 */
	public MapRegion getCurrentRegion() {
		return currentRegion;
	}
	/**
	 * @param currentRegion the currentRegion to set
	 */
	public void setCurrentRegion(MapRegion currentRegion) {
		this.currentRegion = currentRegion;
	}

	public int getMapObjectColumn() {
		return mapObjectColumn;
	}

	public void setMapObjectColumn(int mapObjectColumn) {
		this.mapObjectColumn = mapObjectColumn;
	}

	public int getMapObjectRow() {
		return mapObjectRow;
	}

	public void setMapObjectRow(int mapObjectRow) {
		this.mapObjectRow = mapObjectRow;
	}

	protected Bitmap bitmap;
	protected int mapObjectRow;
	protected int mapObjectColumn;
		
	public Bitmap getBitmap( ) { return bitmap; }
	
	public abstract Bitmap getBitmapFrame(int frame);
	
	public MapObject(  Bitmap bitmap )
	{
		this.bitmap = bitmap;
	}
	
	public MapObject( MapObjectType mapObjectType )
	{
		this.setMapObjectType(mapObjectType);
		bitmap = null;
	}
	
	public MapObject( )
	{
		this.bitmap = null;
	}
	
	public MapObjectType getMapObjectType() {
		return mapObjectType;
	}
	public void setMapObjectType(MapObjectType mapObjectType) {
		this.mapObjectType = mapObjectType;
	}
}
